<div bsModal #secondModal="bs-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="secondModal"
  aria-hidden="true" [config]="{backdrop: false}">
  <div class="modal-dialog">
    <div class="modal-content">
      <form *ngIf="active" #secondForm="ngForm" novalidate (ngSubmit)="save()">

        <div class="modal-header">
          <h4 class="modal-title">
            <span>退库操作</span>
          </h4>
          <button type="button" class="close" (click)="close()" aria-label="Close">
            <span aria-hidden="true">&times;</span>
          </button>
        </div>

        <div class="modal-body">
          <!-- <p-treeTable [value]="areas" selectionMode="single" [(selection)]="area" dataKey="displayName">
              <ng-template pTemplate="header">
                  <tr>
                      <th style="width: 150px;">位置</th>
                  </tr>
              </ng-template>
              <ng-template pTemplate="body" let-rowNode let-rowData="rowData">
                  <tr [ttRow]="rowNode" [ttSelectableRow]="rowNode">
                      <td>
                          <p-treeTableToggler [rowNode]="rowNode" style="color: #5867dd;">
                          </p-treeTableToggler>
                          {{ rowData.displayName }}
                      </td>
                  </tr>
              </ng-template>
          </p-treeTable> -->
          <selectLocation [(location)]="positionId"></selectLocation>
          <label>退库数量
            <span class="text-danger">*</span>
          </label>
          <div class="form-group form-md-line-input form-md-floating-label no-hint">
            <input class="form-control" name="quantity" [ngClass]="{'edited': quantity}" [(ngModel)]="quantity"
              >
          </div>
          <label>退库备注
          </label>
          <div class="form-group form-md-line-input form-md-floating-label no-hint">
            <textarea class="form-control" type="text" name="remark" [ngClass]="{'edited': remark}" [(ngModel)]="remark"
              rows="2"></textarea>
          </div>
        </div>

        <div class="modal-footer">
          <button [disabled]="saving" type="button" class="btn btn-default" (click)="close()">{{l("Cancel")}}</button>
          <button type="submit" class="btn btn-primary blue" [disabled]="!(secondForm.form.valid)" [buttonBusy]="saving"
            [busyText]="'退库中...'">
            <i class="fa fa-hourglass-half"></i>
            <span>退库</span>
          </button>
        </div>

      </form>

    </div>
  </div>
</div>
